package com.example.zz.example.pattern.proxy.staticproxy;

import android.util.Log;

/**
 * Describe:
 *
 * @author zhangzhuo18.
 * Date: 2024/6/21
 */
public class ImageProxy implements ImageInterface {

    private String name;
    ImageInterface image;

    public ImageProxy(String name) {
        this.name = name;
    }

    @Override
    public void display() {
        if (name == null) {
            Log.e("ImageProxy", "name is null");
            return;
        } else {
            Log.e("ImageProxy", "name = " + name);
        }
        if (image == null) {
            image = new Image(name);
        }
        image.display();
    }
}
